﻿#include <REGX52.H>
#include "Delay.h"
#include "LCD1602.h"
#include "MatrixKey.h"

unsigned char key_num;

void main() {
    LCD_Init();
	LCD_ShowString(1, 1, "MatrixKey:");
    while (1) {
        key_num = MatrixKey();
    	// 判断按键按下 key_num != 0 时再执行操作，否则会在下一个循环立刻被刷新为0
		if (key_num) {
			LCD_ShowNum(2, 1, key_num, 2);
		}
    }
}
